﻿Public Class Wfrm_Inf_basica_cliente
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            ViewState("id") = Request("id")
            Carga_Formulario()
        End If

    End Sub
    Sub Carga_Formulario()

        Dim rp As New DotNetResponse.SQLPersistence
        Dim exec As New DotNetDal.SQLPersistence(False, "cnn", DotNetDal.SQLPersistence.Provider.SQLCLIENT)
        'Dim comited As Boolean = Conexion.Conectar(exec)
        rp.StoredProcedure = "SP_GET_UP_DATOS_BASICOS_PERSONA"
        rp.AddParametro(ViewState("id"))
        exec.ExecuteDataTable(rp)
        If rp.TieneDatos Then
            Dim i As Integer
            For i = 0 To rp.DtTable.Rows.Count - 1
                Dim j As Integer
                For j = 0 To rp.DtTable.Columns.Count - 1
                    If Not Me.FindControl(rp.DtTable.Columns(j).ColumnName) Is Nothing Then
                        DirectCast(Me.FindControl(rp.DtTable.Columns(j).ColumnName), Anthem.TextBox).Text = rp.DtTable.Rows(i).Item(j).ToString()
                    End If

                Next
            Next
        End If

        ' DataGrid1.DataSource = rp.DtTable
        ' DataGrid1.DataBind()

    End Sub

End Class